package com.example.config;

import io.minio.MinioClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Slf4j
@Configuration
public class MinioConfig {

    // minio 地址
    private static String URL = "http://121.41.72.27:9000";
    // 用户ID
    private static String ACCESSKEY = "minio";
    // 密钥
    private static String SECRETKEY = "minio123";

    /**
     * @Description:
     * @Author: zhengyue
     * @Date: 2020/10/29 9:33
     * @Param: []
     * @Return: io.minio.MinioClient
     */
    @Bean
    public MinioClient minioClient() {
        try {
            return new MinioClient(URL, ACCESSKEY, SECRETKEY);
        }
        catch (final Exception e) {
            return null;
        }
    }

}